package mlz.d_interface.demo02;

import java.util.ArrayList;

//班级管理类 -> 有一堆学生
public class ClassManager {
    private ArrayList<Student> list = new ArrayList<>();//4个人
    //选择方案一 或者 方案二
    private StudentOperator studentOperator = new StudentOperatorImpl1();

    public ClassManager() {
        list.add(new Student("张三",'男',99));
        list.add(new Student("李四",'女',100));
        list.add(new Student("王五",'男',90));
        list.add(new Student("赵六",'女',80));
    }

    //打印全部学生的信息
    public void printInfo(){
        studentOperator.printAllInfo(list);
    }

    //打印全部学生平均分
    public void printScore(){
        studentOperator.printAvgScore(list);
    };
}
